package org.example.service.impl;


import jakarta.annotation.Resource;
import org.example.feign.OrderFeign;
import org.example.feign.StoreFeign;
import org.example.service.BusinessService;
import org.springframework.stereotype.Service;

@Service
public class BusinessServiceImpl implements BusinessService {
    @Resource
    private OrderFeign orderFeign;
    @Resource
    private StoreFeign storeFeign;

    @Override

    public void purchase(String userId, String commodityCode, int orderCount) {
        storeFeign.deduct(commodityCode, -orderCount);
        orderFeign.createOrder(userId, commodityCode, orderCount);
        System.out.println("开始执行业务逻辑");
    }
}
